package com.deewin.provider.controller;

//import com.deewin.mystarter.MyBean;
import com.deewin.provider.service.HelloService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Controller;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

@Controller
@RequestMapping(value ="/hello")
public class HelloController {

//    @Autowired
//    private MyBean myBean;

    @Value("${dubbo.protocol.name}")
    private String url;

    @Autowired
    private HelloService helloService;

//    @GetMapping("/t")
//    @ResponseBody
//    public String t() {
//        return myBean.toString();
//    }

    @GetMapping("/hello")
    @ResponseBody
    public String hello(){
        System.out.println(url);
        return url;
    }

    @GetMapping("/test")
    @ResponseBody
    public String test(){
        return helloService.sayHello(" deewin");
    }
}
